<!doctype html>
<html lang="en">
 <head> 
  <meta charset="UTF-8"> 
  <meta name="description" content="燎火的个人博客"> 
  <meta name="keyword" content="燎火,qq799378666,软件开发,java,c#,js,html,html5,css"> 
  <title>linux安装svn服务器，配置提交同步更新到服务器</title> 
  <script src="/js/jquery-1.11.1.min.js"></script> 
  <script src="/js/bootstrap-3.3.5/js/bootstrap.js"></script> 
  <link href="/js/bootstrap-3.3.5/css/bootstrap.css" rel="stylesheet"> 
  <script src="/js/base.js"></script> 
  <script src="/js/nav.js"></script> 
  <script src="/js/jquery.toTop.min.js"></script> 
  <link href="/style/article.css" rel="stylesheet"> 
 </head> 
 <body> 
  <div id="main"> 
   <h3 id="title">linux安装svn服务器，配置提交同步更新到服务器</h3> 
   <div id="content">
    <h1 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 24px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">VN</strong><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">版本控制服务</strong></h1>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">SVN是Subversion的简称，是一个开放源代码的版本控制系统，相较于CVS，它采用了分支管理系统，它的设计目标就是取代CVS。互联网上很多版本控制服务已从CVS迁移到Subversion。也是就是CVS的接班人！</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">CVS是一个C/S系统，是一个常用的代码版本控制软件。主要在开源软件管理中使用。与它相类似的代码版本控制软件有subversion。多个开发人员通过一个中心版本控制系统来记录文件版本，从而达到保证文件同步的目的。CVS版本控制系统是一种GNU软件包，主要用于在多人开发环境下的源码的维护。但是由于之前CVS编码的问题，现在大多数软件开发公司都使用SVN替代了CVS。</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">官方网站：<a href="http://subversion.apache.org/" target="_blank" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;border: none;outline: 0px;transition: color 0.3s;color: rgb(68, 102, 187)">http://subversion.apache.org/</a></p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">Windows客户端 TortoiseSVN：<a href="http://tortoisesvn.net/" target="_blank" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;border: none;outline: 0px;transition: color 0.3s;color: rgb(68, 102, 187)">http://tortoisesvn.net/</a>&nbsp;</p>
    <h2 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 22px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">常见的版本控制软件</strong></h2>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">CVS，逐渐被SVN取代，是CVX重写版和改写版</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">SVN，Subversion</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">Git，Git是一个开源的分布式版本控制系统，用以有效、高速的处理从很小到非常大的项目版本管理。Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件</p>
    <h2 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 22px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">SVN存储数据的方式</strong></h2>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">BDB，Berkeley&nbsp;DB，一种事务安全型表类型</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">FSFS，"FSFS" 采用文件系统的方式, 替代原来的基于Berkeley DB的实现.</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">因为BDB方式在服务器中断时，有可能锁住数据，所以还是FSFS方式更安全一点。</p>
    <h2 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 22px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">SVN的运行方式及端口</strong></h2>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">独立服务器 3690端口 访问方式SVN:// &nbsp;&nbsp;&nbsp;C/S模式</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">借助apache运行 80端口 访问方式 http://&nbsp;</p>
    <h2 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 22px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">工作流程</strong></h2>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">集中式代码管理的核心是服务器，所有开发者在开始新一天的工作之前必须从服务器获取代码，然后开发，最后解决冲突，提交。所有的版本信息都放在服务器上。如果脱离了服务器，开发者基本上可以说是无法工作的。下面举例说明：开始新一天的工作：</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">1、从服务器下载项目组最新代码。</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">2、进入自己的分支，进行工作，每隔一个小时向服务器自己的分支提交一次代码</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">（很多人都有这个习惯。因为有时候自己对代码改来改去，最后又想还原到前一个小时的版本，或者看看前一个小时自己修改了哪些代码，就需要这样做了）。</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">3、下班时间快到了，把自己的分支合并到服务器主分支上，一天的工作完成，并反映给服务器。</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">这就是经典的svn工作流程，从流程上看，有不少缺点，但也有优点。</p>
    <h2 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 22px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">SVN+Apache运行原理</strong></h2>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">SVN搭配Apache的时候，Apache需要使用mod_dav_svn这个模块，他的运行机制如下：</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><img alt="" height="95" src="http://static.oschina.net/uploads/space/2016/1101/201518_IAz5_862118.png" width="548"></p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">&nbsp;</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">&nbsp;</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">&nbsp;</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">在一台服务器上建立一个源代码库，库里可以存放许多不同项目的源程序。有源代码库管理员统一管理这些源程序。</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">每个用户在使用源代码库之前，首先要把源代码库里德项目文件下载到本地，然后开发人员可以在本地修改，左后用svn命令进行提交，由源代码库统一管理修改。</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">mod_dav_svn 可以让版本库通过http协议实现网站展现</p>
    <h2 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 22px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">构建SVN版本控制服务器</strong></h2>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">SVN+HTTP&nbsp;Server&nbsp;（XueGod63）==========&nbsp;Client&nbsp;Server（XueGod64）</p>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">检查是否已安装</h3>
    <pre class="hljs nginx" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">rpm&nbsp;-qa&nbsp;subversion</pre>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">如果要卸载旧版本</h3>
    <pre class="hljs nginx" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">yum&nbsp;remove&nbsp;subversion</pre>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">软件安装</strong></h3>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">&nbsp;</p>
    <pre class="hljs elixir" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">#包括HTTP所需模块一起装（httpd&nbsp;mod_auth_mysql&nbsp;是安装配合Apache的模块，你可以只装subversion，多装了也无所谓）&nbsp;[root@XueGod63&nbsp;~]#&nbsp;yum&nbsp;install&nbsp;-y&nbsp;subversion&nbsp;httpd&nbsp;mod_dav_svn&nbsp;#查看已注册&nbsp;[root@XueGod63&nbsp;~]#&nbsp;cat&nbsp;/etc/services&nbsp;|&nbsp;grep&nbsp;--color&nbsp;svn</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">svn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3690/tcp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Subversion<br>svn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3690/udp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Subversion</p>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">创建版本库目录</strong></h3>
    <pre class="hljs elixir" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">#存放版本库的主目录&nbsp;[root@XueGod63&nbsp;~]#&nbsp;mkdir&nbsp;/www/svn/&nbsp;#创建项目&nbsp;#svnadmin命令是由subversion这个软件包提供的&nbsp;[root@XueGod63&nbsp;~]#&nbsp;svnadmin&nbsp;create&nbsp;/www/svn/test_project&nbsp;#随便查看一个版本库&nbsp;[root@XueGod63&nbsp;~]#&nbsp;ls&nbsp;/www/svn/test_project</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">conf &nbsp;db &nbsp;format &nbsp;hooks &nbsp;locks &nbsp;README.txt</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">dav目录：是提供apache与mod_dav_svn使用的目录，让他们存储内部数据，刚开始新建时此目录没有</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">db目录：就是所有版本控制的数据存放文件</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">hooks目录：放置hook脚本文件的目录</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">locks目录：用来放置subversion监控锁定数据的目录，用来追踪存取文件库的客户端</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">format文件：是一个文本文件，里面只放了一个整数。表示当前文件库配置的版本号</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">conf目录：是这个仓库的配置文件（仓库的用户访问账号、权限等），也是我们要关注的配置文件</p>
    <pre class="hljs elixir" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">[root@XueGod63&nbsp;~]#&nbsp;ls&nbsp;/www/svn/test_project/conf/</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">authz &nbsp;passwd &nbsp;svnserve.conf</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">authz &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #认证权限相关</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">passwd &nbsp;&nbsp;&nbsp;&nbsp; #用户名和密码</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">svnserve.conf &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #服务器配置文件</p>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">针对不同版本库修改配置文件</strong></h3>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">接下来的一段用于配置使用哪种授权登录方式；</p>
    <pre class="hljs elixir" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">#修改xuegod.cn的配置文件&nbsp;[root@XueGod63&nbsp;~]#&nbsp;vim&nbsp;/www/svn/test_project/conf/svnserve.conf</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">[</strong>general<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">]</strong></p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">anon-access&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;none &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #对于匿名用户，无访问权限，<span style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;color: rgb(255, 0, 0)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">这里必须为none，因为只有设为none，在客户端才能看到每次提交的备注信息</strong></span></p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">auth-access&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;write &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #对于授权用户，有写权限，可以是read，write，none</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">#password-db&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;passwd &nbsp;&nbsp;&nbsp; #用户名和密码都是明文存放在同级目录下的passwd文件中；优点是高效配置简单，缺点是安全性弱，明文总不是那么让人感觉可靠</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">authz-db&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;authz &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #认证权限文件，取消注释即可</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">realm&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;test_project &nbsp; #指定授权所属的域，PHP的同志可将其理解为名字空间；</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">#接下来是[sasl]段，用于标识是否进行SASL加密处理；</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">use-sasl = true</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">min-encryption = 128</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">max-encryption = 256</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">#变量 min-encryption 和 max-encryption 控制服务器所需要的加密强度。</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><span style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;color: rgb(255, 0, 0)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">注意：此配置文件的所有内容必须顶格，否则会报错</strong></span></p>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">配置用户和密码及认证权限</strong></h3>
    <pre class="hljs elixir" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">#设置用户名和密码&nbsp;[root@XueGod63&nbsp;~]#&nbsp;vim&nbsp;/www/svn/test_project/conf/passwd</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">[</strong>users<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">]</strong>&nbsp;&nbsp;&nbsp;&nbsp;</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">Find&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;123456</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">HA&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;123456</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">user&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;123456</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">#末尾添加上面三行</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">#对于部分版本，前面的[users]是有#号的，如果有#号，一定要取消，否则只能使用匿名用户登录，客户端登录不会</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">出现登录窗口或密码提示，除非在配置文件将anon设置为none，否则将返回一个错误</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">#这里的密码都是明文，没有加密</p>
    <pre class="hljs elixir" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">#设置用户和组的权限&nbsp;[root@XueGod63&nbsp;~]#&nbsp;vim&nbsp;/www/svn/test_project/conf/authz</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">[</strong>groups<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">]</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #此行默认存在了<br>test_group = Find,HA &nbsp; &nbsp; &nbsp; &nbsp; #定义组，在[groups]下面添加</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#用户组格式 用户组名 = 用户1，用户2</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#一个组可以包含多个用户，英文逗号间隔，用户名必须是在passwd中存在的<br><br><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">[test_project:/]</strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#/表示我当前所在版本库目录，这里代表test_project<br><br><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">@</strong>test_group&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;rw &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #@test_group表示这个组的权限，就是上面定义的组的成员<br><br><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">*</strong>&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;#除了上面的有赋予权限成员之外，其他的成员都没有权限</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><span style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;color: rgb(105, 105, 105)">SVN目录格式：</span></p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><span style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;color: rgb(105, 105, 105)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">[/</strong>目录名<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">]</strong></span></p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><span style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;color: rgb(105, 105, 105)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">@</strong>用户组名&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;权限</span></p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><span style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;color: rgb(105, 105, 105)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用户名&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;权限</span></p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><span style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;color: rgb(105, 105, 105)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">*</strong>&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;</span></p>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">SVN使用SASL加密</strong></h3>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">1.配置svnserve.conf，注释掉password-db = passwd</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">并启用sqsl：use-sasl = true</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">2.新建一个svn.conf文件，一般放在/usr/lib/sasl2或者/etc/sasl2，内容为：</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">pwcheck_method: auxprop</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">auxprop_plugin: sasldb</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">sasldb_path: /home/svnadmin/config/sasldb</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">mech_list: DIGEST-MD5</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">其中sasldb_path 指定你打算将sasl加密的数据库放置的位置；</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">注释：pwcheck_method指明检查的方法，这里是“auxprop ”，这个pwcheck_method还对应了如启动一个代理作为认证服务等方式，而现在的意思就是使用本文件说的方式去检查。然后我们指明auxprop_plugin为sasldb，也就是使用一个文件存放用户名密码，也就是/www/svn/test_project/sasldb,其它的认证信息存放plugin还有sql和ldapdb。而mech_list指明了认证信息传递机制。</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">svnserve 已经在运行，你需要重启服务，并确保它读取了更新后的配置参数</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">killall svnserve //停止svnserve服务</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">svnserve –d –r /www/svn //启动svnserve服务</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">3.创建用户和密码</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">使用saslpasswd2 程序</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">语法：saslpasswd2 –c –f /www/svn/test_project/sasldb –u [svnserve.conf里面配置的realm名字] [username]</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">eg：saslpasswd2 -c&nbsp; -f /home/svnadmin/config/sasldb -u examPro colin</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">会出现交互界面，提示输入两次密码；</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">附：</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">saslpasswd2 -d -f home/svnadmin/config/sasldb -u 用户名//删除用户</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">sasldblistusers2 -f /home/svnadmin/config/sasldb // 查询用户</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">PS：如果访问库的时候出现以下提示 "Could not obtain the list of SASL mechanisms"，原因是Linux默认没有安装DIGEST-MD5，此时，可用以下命令安装更新：yum install cyrus-sasl-md5 , cyrus-sasl-md5首页:<a href="http://asg.web.cmu.edu/sasl/" target="_blank" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;border: none;outline: 0px;transition: color 0.3s;color: rgb(68, 102, 187)">http://asg.web.cmu.edu/sasl/</a>, 安装包下载地址:<a href="ftp://ftp.andrew.cmu.edu/pub/cyrus/" target="_blank" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;border: none;outline: 0px;transition: color 0.3s;color: rgb(68, 102, 187)">ftp://ftp.andrew.cmu.edu/pub/cyrus/</a></p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">配置完成。</p>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">服务SVN启动及创建测试代码</strong></h3>
    <pre class="hljs elixir" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">#启动了所有版本库，如果只需要某一个版本库，&nbsp;#在-r后面添加/www/svn/test_project/的版本库即可&nbsp;-d=daemon&nbsp;-r=root&nbsp;of&nbsp;directory&nbsp;of&nbsp;save指定根目录&nbsp;[root@XueGod63&nbsp;~]#&nbsp;svnserve&nbsp;-d&nbsp;-r&nbsp;/www/svn/&nbsp;#查询到下面这行内容就可以了&nbsp;[root@XueGod63&nbsp;~]#&nbsp;ps&nbsp;-aux&nbsp;|&nbsp;grep&nbsp;svn</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">root &nbsp; &nbsp; 17107 &nbsp;0.0 &nbsp;0.0 199020 &nbsp;1028 ? &nbsp; &nbsp; &nbsp; &nbsp;Ss &nbsp; 23:30 &nbsp; 0:00 svnserve -d -r /www/svn/</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">root &nbsp; &nbsp; 17446 &nbsp;0.0 &nbsp;0.0 110228 &nbsp; 892 pts/0 &nbsp; &nbsp;S+ &nbsp; 23:32 &nbsp; 0:00 grep --color=auto svn</p>
    <pre class="hljs elixir" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">[root@XueGod63&nbsp;~]#&nbsp;netstat&nbsp;-antup&nbsp;|&nbsp;grep&nbsp;svn</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">服务正常</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">tcp &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp;0 0.0.0.0:3690 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0:* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LISTEN &nbsp; &nbsp; &nbsp;17107/svnserve</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">使用svn导入测试代码</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">导入测试代码格式： &nbsp;&nbsp;svn&nbsp;[选项] 源码&nbsp;&nbsp;svn://server&nbsp;ip/项目名</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">常见的选项：</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">import：将未版本化的文件纳入版本控制并提交 checkout：从版本库中检出一个修订版 update：更新工作拷贝 add，delete，copy，move：增、删、复制、移动文件或目录</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">status：检查状态差异 diff：检查文件行级详细差异</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">revert：恢复 resolve：解决冲突</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">switch：切换工作拷贝对应的版本库分支 log：查看历史记录</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">list：显示文件目录 cat：查看某个文件内容</p>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">开放svn端口</strong></h3>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">默认是3690端口，你也可以用别的。已开启的跳过这一步</p>
    <pre class="hljs nginx" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">vi&nbsp;/etc/sysconfig/iptables&nbsp;#修改&nbsp;iptables&nbsp;-I&nbsp;INPUT&nbsp;-p&nbsp;tcp&nbsp;--dport&nbsp;3690&nbsp;-j&nbsp;ACCEPT&nbsp;#保存&nbsp;service&nbsp;iptables&nbsp;save&nbsp;#重启&nbsp;service&nbsp;iptables&nbsp;restart&nbsp;#查看&nbsp;/etc/init.d/iptables&nbsp;status</pre>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">在网站根目录建立SVN版本库</strong></h3>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">为了避免每次都重新输入SVN账号密码，可修改以下配置</p>
    <pre class="hljs elixir" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">[root@localhost&nbsp;public_html]#&nbsp;vim&nbsp;/root/.subversion/servers</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">把</p>
    <pre class="hljs bash" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">#&nbsp;store-plaintext-passwords&nbsp;=&nbsp;no</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">改为</p>
    <pre class="hljs ini" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">store-plaintext-passwords&nbsp;=&nbsp;yes</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">建立版本库</p>
    <pre class="hljs elixir" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">#打开网站根目录，我的根目录是/www/web/test_com/public_html&nbsp;[root@XueGod63&nbsp;~]#&nbsp;cd&nbsp;/www/web/test_com/public_html&nbsp;#在网站根目录建立版本库，由于当前已经在网站根目录，所以用&nbsp;.&nbsp;表示建立版本库的目录&nbsp;#也可以使用绝对路径&nbsp;/www/web/test_com/public_html&nbsp;[root@XueGod63&nbsp;~]#&nbsp;svn&nbsp;checkout&nbsp;svn://192.168.1.2/test_project&nbsp;.&nbsp;#提示输入SVN帐号和密码，输入以上设置的SVN帐号密码即可</pre>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">提交网站根目录的源码到SVN服务器</strong></h3>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">把网站的所有文件提交到SVN服务器</p>
    <pre class="hljs elixir" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">#把项目加入到SVN库，并提交&nbsp;[root@XueGod63&nbsp;~]#&nbsp;svn&nbsp;add&nbsp;app/&nbsp;[root@XueGod63&nbsp;~]#&nbsp;svn&nbsp;add&nbsp;include/&nbsp;[root@XueGod63&nbsp;~]#&nbsp;svn&nbsp;add&nbsp;template/&nbsp;[root@XueGod63&nbsp;~]#&nbsp;svn&nbsp;add&nbsp;runtime/&nbsp;[root@XueGod63&nbsp;~]#&nbsp;svn&nbsp;add&nbsp;index.php&nbsp;[root@XueGod63&nbsp;~]#&nbsp;svn&nbsp;commit&nbsp;-m&nbsp;"初次提交"</pre>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">在开发环境（本地）检出项目</strong></h3>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">在本地项目检出SVN，SVN地址：svn://192.168.1.2/test_project</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">d:守护进程<br>-r:svn根目录<br>假设服务端IP为192.168.1.2，那么如下设置后test_project的访问目录就为：</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">svn://192.168.1.2/test_project</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">比如 帐号密码为上面设置的Find&nbsp;<strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">=</strong>&nbsp;123456，检出。</p>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">SVN上传时同步到服务器其它目录</strong></h3>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">同步程序思路：用户提交程序到SVN，SVN触发hooks，按不同的hooks进行处理，这里用到的是post-commit，利用post-commit到代码检出到SVN服务器的本地硬盘目录，再通过rsync同步到远程的WEB服务器上。</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">知识点：</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">1、SVN的hooks</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"># start-commit 提交前触发事务</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"># pre-commit 提交完成前触发事务</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"># post-commit 提交完成时触发事务</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"># pre-revprop-change 版本属性修改前触发事务</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"># post-revprop-change 版本属性修改后触发事务</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">通过上面这些名称编写的脚本就就可以实现多种功能了，相当强大。</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">2、同步命令rsync的具体参数使用</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">3、具有基个语言的编程能力bash python perl都可以实现</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">post-commit具体实现细节</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">post-commit脚本</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">能看到一堆模版钩子文件，我们需要的是post-commit.tmpl，</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">copy一份，命名为post-commit。然后修改；</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">编辑文件：</p>
    <pre class="hljs groovy" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">sudo&nbsp;vim&nbsp;/www/svn/test_project/hooks/post-commit</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">注意：编辑完成post-commit后，给予可执行权限：</p>
    <pre class="hljs groovy" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">sudo&nbsp;chmod&nbsp;-R&nbsp;755&nbsp;/www/svn/test_project/hooks/post-commit</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">内容：</p>
    <pre class="hljs bash" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">#!/bin/sh&nbsp;&nbsp;#设置语言环境&nbsp;##这行比较重要，需要根据你的服务器环境选择正确的语言环境，否则，这个update不会工作&nbsp;export.UTF-8&nbsp;#设置SVN更新时需要同步更新的目录，这里发现不加username和password也是可以的&nbsp;#svn&nbsp;update&nbsp;/www/web/test_com/public_html&nbsp;--username&nbsp;yoursname&nbsp;--password&nbsp;yourpwd&nbsp;sudo&nbsp;svn&nbsp;update&nbsp;/www/web/test_com/public_html</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">这样在本地SVN提交代码后，服务器的代码也会自动从SVN更新。</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">注意：svn仓库文件夹的other必须要有执行权限不然脚本无法执行。SVN update 之前一定要先手动checkout一份出来，还有这里一定要添加用户和密码如果只是手动一样会更新，但自动一样的不行。</p>
    <h2 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 22px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">启动和停止SVN服务</strong></h2>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">启动SVN服务</strong></h3>
    <pre class="hljs bash" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">svnserve&nbsp;-d&nbsp;-r&nbsp;/www/svn/</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">描述说明：<br>-d 表示svnserver以“守护”进程模式运行<br>-r 指定文件系统的根位置（版本库的根目录），这样客户端不用输入全路径，就可以访问版本库。</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">如果想监听其他端口，使用</p>
    <pre class="hljs lua" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">svnserve&nbsp;-d&nbsp;-r&nbsp;/www/svn/&nbsp;--listen-port&nbsp;88</pre>
    <h3 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 18px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)"><strong style="box-sizing: inherit;-webkit-tap-highlight-color: transparent">停止SVN服务</strong></h3>
    <pre class="hljs nginx" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">killall&nbsp;svnserve</pre>
    <h2 style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;font-size: 22px;font-weight: 500;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">设置开机自启动</h2>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">安装好的svn服务端，默认是不会开机自启动的，每次开机自己启动会很麻烦，我们可以把它设成开机启动。</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">首先：编写一个启动脚本svn_startup.sh，我放在/www/svn/svn_startup.sh</p>
    <pre class="hljs bash" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">#!/bin/bash&nbsp;/usr/bin/svnserve&nbsp;-d&nbsp;-r&nbsp;/www/svn/&nbsp;--listen-port&nbsp;88</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">如果是部署为外网，这里自定义了88端口，需要注意检出地址需要加上自定义的端口号。（貌似自定义端口号后不能使用post-commit自动提交了，会提示拒绝连接，还没有找到使用自定义端口连接的方法）</p>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">这里的svnserve路径保险起见，最好写绝对路径，因为启动的时候，环境变量也许没加载。<br>绝对路径怎么查？</p>
    <pre class="hljs bash" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">which&nbsp;svnserve</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">这里还有可能碰到一个问题，如果你在windows下建立和编写的脚步，拿到linux下，用vi或者vim修改后可能会无法执行，这是文件格式的问题：</p>
    <pre class="hljs bash" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">vi&nbsp;svn_startup.sh&nbsp;#输入：set&nbsp;ff&nbsp;回车&nbsp;#如果显示的结果不是fileformat=unix&nbsp;#再次输入&nbsp;set&nbsp;ff=unix&nbsp;#就OK了</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">然后修改该脚本的执行权限：</p>
    <pre class="hljs perl" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">chmod&nbsp;ug+x&nbsp;svn_startup.sh&nbsp;#或者万能的&nbsp;chmod&nbsp;777&nbsp;svn_startup.sh</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">最后，加入自动运行：</p>
    <pre class="hljs nginx" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">vi&nbsp;/etc/rc.d/rc.local&nbsp;#在末尾添加脚本的路径，如：&nbsp;/www/svn/svn_startup.sh</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">现在，你可以重启一下试试了。 不懂得怎么确认成功？败给你了</p>
    <pre class="hljs nginx" style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;overflow-x: auto;padding: 2px;background-color: rgb(63, 63, 63);color: rgb(220, 220, 220);border-radius: 3px;line-height: 1.4;word-wrap: normal;font-size: 13px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace">ps&nbsp;-ef|grep&nbsp;svnserve</pre>
    <p style="box-sizing: inherit;-webkit-tap-highlight-color: transparent;margin-bottom: 16px;color: rgb(61, 70, 77);font-family: 'Pingfang SC', STHeiti, 'Lantinghei SC', 'Open Sans', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', SimSun, sans-serif;white-space: normal;background-color: rgb(248, 248, 248)">&nbsp;</p>
    <p><br></p>
   </div> 
  </div>  
 </body>
</html>